<?php
	$db = new mysqli('localhost', 'root', '', 'joomviet');
	
	if(!$db) {

		echo 'ERROR: Không th? k?t n?i v?i co s? d? li?u.';
	} 
    else 
    {
		if(isset($_POST['manv'])) {
		  if($_SESSION['id_a_b']==0)//neu o tru so chinh
			{
			 $manv = $db->real_escape_string($_POST['manv']);
			 if(strlen($manv) >0) 
             {
				$query = $db->query("SELECT * FROM hff_erp_product_custom_account WHERE id_cus LIKE '$manv%' LIMIT 10");
				if($query) 
                {
					while ($result = $query ->fetch_object()) 
                    {
	         			echo '<li onClick="fill(\''.$result->id_cus.'\');">'.$result->id_cus.'</li>';     
	         		}
				}
             } 
             else 
             {
					echo 'ERROR: L?i truy v?n';
			 }
			}
            else //nguoc lai
            {
                echo "chi nhanh";
            }
		}
	}
?>